<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- STYLESHEETS -->
    <!--[if lt IE 9]>
    <script src="../../js/flot/excanvas.min.js"></script>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script><![endif]-->
    <link rel="stylesheet" type="text/css" href="../../css/cloud-admin.css">
    <link rel="stylesheet" type="text/css" href="../../css/themes/default.css" id="skin-switcher">
    <link rel="stylesheet" type="text/css" href="../../css/responsive.css">

    <link href="../../font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- file-input -->
    <link rel="stylesheet" type="text/css" href="../../js/file-input/fileinput.css"/>
    <!-- SELECT2 -->
    <link rel="stylesheet" type="text/css" href="../../js/select2/select2.min.css"/>
    <!-- UNIFORM -->
    <link rel="stylesheet" type="text/css" href="../../js/uniform/css/uniform.default.min.css"/>
    <!-- datatable -->
    <link rel="stylesheet" href="../../js/datatables/datatable.css">
    <!-- WIZARD -->
    <link rel="stylesheet" type="text/css" href="../../js/bootstrap-wizard/wizard.css"/>
    <link rel="stylesheet" href="../../js/datepicker/datepicker.css">
    <!-- FONTS
<link href='http://fonts.useso.com/css?family=Open+Sans:300,400,600,700' rel='stylesheet' type='text/css'>
-->
    <!-- JQUERY -->
    <script src="../../js/jquery/jquery-2.0.3.min.js"></script>
    <script src="../../js/common.js"></script>
</head>

<body>
<header class="navbar clearfix" id="header">
</header>

<!-- PAGE -->
<section id="page">
    <!-- SIDEBAR -->
    <div id="sidebar" class="sidebar">
        <div class="sidebar-menu nav-collapse">

            <!-- SIDEBAR MENU -->
            <ul>

            </ul>
            <!-- /SIDEBAR MENU -->
        </div>

    </div>
    <!-- /SIDEBAR -->
    <div id="main-content">

        <div class="container">
            <div class="row">
                <div id="content" class="col-lg-12">
                    <!-- PAGE HEADER-->
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="page-header">
                                <!-- STYLER -->

                                <!-- /STYLER -->
                                <!-- BREADCRUMBS -->
                                <ul class="breadcrumb">
                                    <li>
                                        <i class="fa fa-home"></i>
                                        <a href="index.html">首页</a>
                                    </li>
                                    <li>
                                        <a href="#">商品管理</a>
                                    </li>
                                    <li>维护商品</li>
                                </ul>
                                <!-- /BREADCRUMBS -->

                            </div>
                        </div>
                    </div>
                    <!-- /PAGE HEADER -->
                    <!-- SAMPLE -->
                    <form id="form_coupon">
                        <div class="row col-md-12">
                            <div class="col-md-3" style="width: 25%;height:200px">
                                <div class="" style="text-align: center;margin-top:30%;font-size:24px;">基本信息</div>
                            </div>
                            <div class="col-md-9">


                                <div class="box border primary" style="height:430px">

                                    <div class="row mrg-bt10-right" style="margin-top:10px;">
                                        <label class="control-label col-md-3"><span class="required">*</span>批次ID：</label>
                                        <div class="col-md-8 inline" id="couponId">

                                        </div>
                                    </div>


                                    <div class="row mrg-bt10-right" style="margin-top:10px;">
                                        <label class="control-label col-md-3"><span class="required">*</span>状态：</label>
                                        <div class="col-md-8 inline" id="status">

                                        </div>
                                    </div>


                                    <div class="row mrg-bt10-right" style="margin-top:10px;">
                                        <label class="control-label col-md-3"><span class="required">*</span>创建时间：</label>
                                        <div class="col-md-8 inline" id="createTime">
                                        </div>
                                    </div>


                                    <div class="row mrg-bt10-right" style="margin-top:10px;">
                                        <label class="control-label col-md-3"><span class="required">*</span>优惠劵类型：</label>
                                        <div class="col-md-8 inline" id="couponType">
                                        </div>
                                    </div>
                                    <div class="row mrg-bt10-right" style="margin-top:10px;">
                                        <label class="control-label col-md-3"><span class="required">*</span>优惠劵名称：</label>
                                        <div class="col-md-8 inline " id="couponTitle">

                                        </div>
                                    </div>
                                    <div class="row mrg-bt10-right">
                                        <label class="control-label col-md-3"><span class="required">*</span>发放数量：</label>
                                        <div class="col-md-8 inline" id="sendNum">

                                        </div>
                                    </div>
                                    <div class="row mrg-bt10-right">
                                        <label class="control-label col-md-3"><span class="required">*</span>面额：</label>
                                        <div class="col-md-8 inline" id="faceValue">

                                        </div>
                                    </div>
                                    <div class="row mrg-bt10-right">
                                        <label class="control-label col-md-3"><span class="required">*</span>订单金额:</label>
                                        <div class="col-md-8 inline" style="text-align: left" id="limitPrice">

                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="row col-md-12">
                                <div class="col-md-3" style="width: 25%;height:200px">
                                    <div class="" style="text-align: center;margin-top:30%;font-size:24px;">规则</div>
                                </div>
                                <div class="col-md-9" style="height:auto">
                                    <div class="box border primary">
                                        <div class="row mrg-bt10-right" style="margin-top:10px">
                                            <label class="control-label col-md-3"><span class="required">*</span>每人限领：</label>
                                            <div class="col-md-8 inline" style="text-align: left" id="leadNum">

                                            </div>
                                        </div>
                                        <div class="row mrg-bt10-right">
                                            <label class="control-label col-md-3"><span class="required">*</span>有效期：</label>
                                            <div class="col-md-6 inline " style="display:inline-flex" id="startDate">

                                            </div>

                                        </div>

                                        <div class="row mrg-bt10-right postponeDaysDiv">
                                            <label class="control-label col-md-3"><span class="required">*</span>顺延天数：</label>
                                            <div class="col-md-6 inline constantCouponDiv" style="display:inline-flex" id="postponeDays">

                                            </div>

                                        </div>

                                        <div class="row mrg-bt10-right">
                                            <label class="control-label col-md-3"><span class="required">*</span>可使用商品：</label>
                                            <div class="col-md-1 inline" style="width: 150px;text-align: left" id="productIds">

                                            </div>
                                        </div>
                                        <div class="row mrg-bt10-right">
                                            <label class="control-label col-md-3"><span class="required">*</span>可用品牌：</label>
                                            <div class="col-md-1 inline" style="width: 150px;text-align: left" id="brandName">

                                            </div>
                                        </div>
                                        <div class="row mrg-bt10-right">
                                            <label class="control-label col-md-3"><span class="required">*</span>可用平台：</label>
                                            <div class="col-md-1 inline" style="width: 150px;text-align: left" id="salesPlatform">

                                            </div>
                                        </div>
                                        <div class="row mrg-bt10-right">
                                            <label class="control-label col-md-3"><span class="required">*</span>可领取用户：</label>
                                            <div class="col-md-1 inline" style="width: 150px;text-align: left" id="receiveType">

                                            </div>
                                        </div>
                                        <div class="row mrg-bt10-right">
                                            <label class="control-label col-md-3">使用说明：</label>
                                            <div class="col-md-8 inline" id="remark">


                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                    </form>
                    <!-- /SAMPLE -->

                    <div class="footer-tools">
								<span class="go-top">
								<i class="fa fa-chevron-up"></i> Top
							</span>
                    </div>
                </div>
                <!-- /CONTENT-->
            </div>
        </div>
    </div>
</section>
<!--/PAGE -->
<!-- JAVASCRIPTS -->
<!-- Placed at the end of the document so the pages load faster -->

<!-- BOOTSTRAP -->
<script src="../../bootstrap-dist/js/bootstrap.min.js"></script>

<!-- BLOCK UI -->
<script type="text/javascript" src="../../js/jQuery-BlockUI/jquery.blockUI.min.js"></script>
<!--bootbox-->
<script type="text/javascript" src="../../js/bootbox/bootbox.min.js"></script>
<!-- AUTOSIZE -->
<script type="text/javascript" src="../../js/autosize/jquery.autosize.min.js"></script>
<!-- spinner -->
<script src="../../js/spinner/spin.js"></script>
<!-- INPUT MASK -->
<script type="text/javascript" src="../../js/bootstrap-inputmask/bootstrap-inputmask.min.js"></script>

<!-- SELECT2 -->
<script type="text/javascript" src="../../js/select2/select2.min.js"></script>

<script type="text/javascript" src="../../js/datepicker/datepicker.js"></script>
<script src="../../js/jquery-validate/jquery.validate.min.js"></script>
<!-- COOKIE -->
<script type="text/javascript" src="../../js/jQuery-Cookie/jquery.cookie.min.js"></script>
<!-- CUSTOM SCRIPT -->
<script src="../../js/script.js"></script>

<script src="../../js/Sortable.min.js"></script>
<script>
    var AddCoupon = function () {
        var wizform = $('#form_coupon');

        return {
            init: function () {

                $.initDate($("#rangDate"), 0, 15);
                var couponId = $.getUrlParam("couponId");
                App.init();

                $.ajax({
                    type: "post",
                    url: App.getContextPath() + "admin/coupon/findById.do",
                    async: true,
                    data: {couponId: couponId},
                    success: function (result) {
                        $("#couponId").html(result.id);
                        if ($.getTimeStamp(result.startDate) < 0)
                            $("#status").html("未开始");

                        if ($.getTimeStamp(result.endDate) < 0)
                            $("#status").html("进行中");

                        if ($.getTimeStamp(result.endDate) >= 0)
                            $("#status").html("已完成");


                        $("#createTime").html($.getLocalTime(result.createTime));
                        var couponType = result.couponType;
                        if (couponType == 'Constant') {
                            $("#couponType").html("固定");

                        } else {
                            $("#couponType").html("顺延");

                        }
                        $("#salesPlatform").html(result.salesPlatform);
                        $("#couponTitle").html(result.couponTitle);
                        $("#sendNum").html(result.sendNum);
                        $("#faceValue").html(result.faceValue);
                        $("#limitPrice").html(result.limitPrice);
                        $("#leadNum").html(result.leadNum);
                        $("#remark").html(result.remark);

                        $("#startDate").html($.getLocalTime(result.startDate) + " - " + $.getLocalDate(result.endDate) + " 23 :59");
                        $("#postponeDays").html(result.postponeDays == null ? 0 : result.postponeDays);


                        if (result.sceneType == "ALL") {
                            $("#productIds").html('全站通用');
                        } else if (result.sceneType == "Product") {
                            $("#productIds").html(result.relateIdList.join(","));
                        } else {
                            $("#brandName").html(result.relateIdList.join(","));
                        }
                        var receiveType = "";
                        switch (result.receiveType) {
                            case 0:
                                receiveType = "全部用户";
                                break;
                            case 1:
                                receiveType = "新用户";
                                break;
                            case 2:
                                receiveType = "女王 ";
                                break;
                        }
                        $("#receiveType").html(receiveType);
                    }
                });


            }
        }
    }();
    $(function () {
        $("#header").load("../head.html");
        AddCoupon.init();
    });
</script>

<!-- /JAVASCRIPTS -->
</body>

</html>